﻿using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Http
{
	/// <summary>
	/// 
	/// </summary>
	public interface IHttpHelper
	{
		/// <summary>
		/// 查询请求
		/// </summary>
		/// <param name="Path"></param>
		/// <returns></returns>
		  Task<IResponse> GetAsync(string Path);
	
		/// <summary>
		/// 查询请求
		/// </summary>
		/// <param name="Path"></param>
		/// <param name="Params"></param>
		/// <returns></returns>
		  Task<IResponse> GetAsync(string Path, object Params);

		/// <summary>
		/// 查询请求
		/// </summary>
		/// <param name="Path"></param>
		/// <returns></returns>
		IResponse Get(string Path);

		/// <summary>
		/// 查询请求
		/// </summary>
		/// <param name="Path"></param>
		/// <param name="Params"></param>
		/// <returns></returns>
		IResponse Get(string Path, object Params);

		/// <summary>
		/// 添加请求
		/// </summary>
		/// <param name="Path"></param>
		/// <param name="conext"></param>
		/// <param name="contextType"></param>
		/// <param name="IsFile"></param>
		/// <returns></returns>
		Task<IResponse> PostAsync(string Path, object conext, HttpContextType contextType = HttpContextType.Json,bool IsFile = false);



        /// <summary>
        /// 
        /// </summary>
        /// <param name="Path"></param>
        /// <param name="conext"></param>
        /// <param name="IsFile"></param>
        /// <returns></returns>
        public  Task<IResponse> PostAsync(string Path, object conext, bool IsFile = false);

		/// <summary>
		/// 添加请求
		/// </summary>
		/// <param name="Path"></param>
		/// <param name="conext"></param>
		/// <param name="contextType"></param>
		/// <param name="IsFile"></param>
		/// <returns></returns>
		IResponse Post(string Path, object conext, HttpContextType contextType = HttpContextType.Json,bool IsFile = false);


		/// <summary>
		/// 
		/// </summary>
		/// <param name="Path"></param>
		/// <param name="conext"></param>
		/// <param name="IsFile"></param>
		/// <returns></returns>
		public IResponse Post(string Path, object conext, bool IsFile = false);



		/// <summary>
		/// 更新请求
		/// </summary>
		/// <param name="Path"></param>
		/// <param name="conext"></param>
		/// <param name="contextType"></param>
		/// <param name="IsFile"></param>
		/// <returns></returns>
		Task<IResponse> PutAsync(string Path, object conext, HttpContextType contextType = HttpContextType.Json, bool IsFile = false);


		/// <summary>
		/// 
		/// </summary>
		/// <param name="Path"></param>
		/// <param name="conext"></param>
		/// <param name="IsFile"></param>
		/// <returns></returns>
		public  Task<IResponse> PutAsync(string Path, object conext, bool IsFile = false);


		/// <summary>
		/// 更新请求
		/// </summary>
		/// <param name="Path"></param>
		/// <param name="conext"></param>
		/// <param name="contextType"></param>
		/// <param name="IsFile"></param>
		/// <returns></returns>
		IResponse Put(string Path, object conext, HttpContextType contextType = HttpContextType.Json,bool IsFile = false);


		/// <summary>
		/// 
		/// </summary>
		/// <param name="Path"></param>
		/// <param name="conext"></param>
		/// <param name="IsFile"></param>
		/// <returns></returns>
		public IResponse Put(string Path, object conext, bool IsFile = false);

        /// <summary>
        /// 删除请求
        /// </summary>
        /// <param name="Path"></param>
        /// <returns></returns>
        Task<IResponse> DeleteAsync(string Path);

		/// <summary>
		/// 删除请求
		/// </summary>
		/// <param name="Path"></param>
		/// <returns></returns>
		IResponse Delete(string Path);

		/// <summary>
		/// 
		/// </summary>
		/// <param name="request"></param>
		/// <returns></returns>
		/// <exception cref="Exception"></exception>
		Task<IResponse> RequestAsync(HttpRequestMessage request);

		/// <summary>
		/// 设置当前实例的Key
		/// </summary>
		public void SetKey(string key);
	}
}
